<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<%@ include file="/commons/nocache.jspf" %>
<%@ taglib uri="/FCKeditor" prefix="FCK"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http：//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http：//www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/form.dwt" codeOutsideHTMLIsLocked="true" -->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<script type="text/javascript" src="${ctx}/scripts/datepicker/wpCalendar.js"></script>
<!-- InstanceBeginEditable name="doctitle" -->
<title>提案管理</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="scripts" -->
<script type="text/javascript">
	function deleteIt(id, page) {
	  if(window.confirm('确定要删除吗?')) {
	  	window.location = "${ctx }/proposal/proposal!delete.action?proposal.proposalId="+id+"&flipPageInfo.page="+page;
	  }  
	}		
	function list(){
		document.pageform.submit();
	}
	function outExcel(){
		document.searchform.action="${ctx}/proposal/proposal!outExcel.action";
		document.searchform.submit();
	}
	function search(){
		document.searchform.action="${ctx}/proposal/proposal!search.action";
		document.searchform.submit();
	}
	function modifyIt(id){
		document.getElementById("proposalId").value = id;
		document.modifyform.action="${ctx}/proposal/proposal!modifyPre.action";
		document.modifyform.submit();
	}
	function detailIt(id){
		document.getElementById("proposalId").value = id;
		document.modifyform.action="${ctx}/proposal/proposal!detail.action?s_my=${s_my }";
		document.modifyform.submit();
	}
	function agreeIt(id){
	/**
		$.ajax({

			url 	 : '${ctx}/proposal/proposal!agree.action?proposal.proposalId='+id,
			dataType : 'json',
			success  : function(json){
					alert("支持成功");
			},
			error	 : function(){
			}
		});
		*/
		window.location = '${ctx}/proposal/proposal!agree.action?proposal.proposalId='+id;
	}
	function detailUnionUserName(name){
		alert(name);
	}
</script>
<!-- InstanceEndEditable -->
</head>

<body>

<div id="main">
	<div class="zdsz" id="select1">
		<div class="tab">

<!-- InstanceBeginEditable name="tab" -->
<c:if test="${role.roleId == '1'}">
	<a href="${ctx}/proposal/proposal!index.action?s_my=${s_my }"><h3>添加提案</h3></a>
</c:if>
<a href="${ctx}/proposal/proposal!list.action?s_my=${s_my }"><h3 class="sel">提案查询</h3></a>

<!-- InstanceEndEditable -->
		</div>
		<div class="zd_gut">
			<ul class="block">
				<li>
		
<!-- InstanceBeginEditable name="form" -->
<form action="${ctx}/proposal/proposal!search.action" method="post" name="searchform">
<c:if test="${role.roleId != ROLE_COMMITTEE}">
	<div class="zc_but2">	

         编号:
        <input name="s_proposalNo" type="text" size="5" maxLength="20" value="${s_proposalNo}"/>
        <!--
       	届:
        <input name="s_proposalSession" type="text" size="5" maxLength="20" value="${s_proposalSession}"/>
         次:
        <input name="s_proposalCount" type="text" size="5" maxLength="20" value="${s_proposalCount}"/>
        -->
       	案由:
        <input name="s_proposalBrief" type="text" size="20" maxLength="20" value="${s_proposalBrief}"/>
       	第一提案人:
        <input name="s_proposalUserNameFirst" type="text" size="20" maxLength="20" value="${s_proposalUserNameFirst}"/>        
         界别:
        <input name="s_xmmc" type="text" size="20" maxLength="20" value="${s_jieBie}"/>
        <br>  
         审查意见
        <pro:option selectName="s_proposalAduitSuggestSelect" optionName="proposal.s_proposalAduitSuggestSelect" value="${s_proposalAduitSuggestSelect}" />
        立案类型
        <pro:option selectName="s_proposalRegisterTypeSelect" optionName="proposal.s_proposalRegisterTypeSelect" value="${s_proposalRegisterTypeSelect}"/>
	  提案分类
	  	<pro:option selectName="s_proposalClassify" optionName="proposal.s_proposalClassify" value="${s_proposalClassify}"/>
	  	承办口:
        <pro:option selectName="s_proposalTaketoDept" optionName="proposal.s_proposalUndertakeDept" value="${s_proposalTaketoDept}"/>
	  	<br> 
	  	主办:
	  	<input id="s_proposalSponsor" name="s_proposalSponsor" type="text" size="20" maxLength="14" value="${s_proposalSponsor }" readOnly style="color:gray;"/>
    	<input type="hidden" id="s_proposalSponsorId" name="s_proposalSponsorId" value="${s_proposalSponsorId}"/>
    	<input type="button" onclick="choose('${ctx}/proposal/proposal!chooseProposalDept.action', 's_proposalSponsorId','s_proposalSponsor');" value="+添加" class="log_f">
    	<input type="button" onclick="deleteChoose('s_proposalSponsorId','s_proposalSponsor');" value="-清空" class="log_f">
         会办:
        <input id="s_proposalNeeddo" name="s_proposalNeeddo" type="text" size="14" maxLength="20" value="${s_proposalNeeddo }" readOnly style="color:gray;"/>
	    <input type="hidden" id="s_proposalNeeddoId" name="s_proposalNeeddoId" value="${s_proposalNeeddoId}" />
	    <input type="button" onclick="choose('${ctx}/proposal/proposal!chooseProposalDept.action', 's_proposalNeeddoId','s_proposalNeeddo');" value="+添加" class="log_f">
	    <input type="button" onclick="deleteChoose('s_proposalNeeddoId','s_proposalNeeddo');" value="-清空" class="log_f">
        
         提案时间：从        
        <input id="startDate" name="startDate" type="text" disabled="disabled" class="input01" size="10" maxlength="10" value="<s:date name='startDate' format='yyyy-MM-dd' />"/>
    	<img src="${ctx}/images/main/calendar.gif" align="absmiddle" border="0" style="cursor:hand" onclick="showCalendar(this,document.getElementById('startDate'));" />
    	到
    	<input id="endDate" name="endDate" type="text" disabled="disabled" class="input01" size="10" maxlength="10" value="<s:date name='endDate' format='yyyy-MM-dd' />"/>
    	<img src="${ctx}/images/main/calendar.gif" align="absmiddle" border="0" style="cursor:hand" onclick="showCalendar(this,document.getElementById('endDate'));" />
    	<br> 
	  	答复状态:
        <pro:option selectName="s_proposalUndertakeDeptSuggest" optionName="proposal.s_proposalUndertakeDeptSuggest" value="${s_proposalUndertakeDeptSuggest}"/>
         办理状态:
        <pro:option selectName="s_proposalDealStatus" optionName="proposal.s_proposalDealStatus" value="${s_proposalDealStatus}"/>
         满意度:
        <pro:option selectName="s_proposalSatisfy" optionName="proposal.s_proposalSatisfy" value="${s_proposalSatisfy}"/>

        <input name="button"  type="button" onclick="search();" class="log_f zc_b" value="查询"/>
        <input name="button"  type="button" onclick="outExcel();" class="log_f zc_b" value="导出excel"/>
    </div>
</c:if>
</form>
<div id="ErrorName"  align="center"></div>

<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="tab_1 center"  >
	<tr>
	<tr>
  	  <td class="bg4"><strong>类别编号</strong></td>
      <td class="bg4"><strong>第一提案人</strong></td>
	  <td class="bg4"><strong>案由</strong></td>		 
	  <td class="bg4"><strong>提案日期</strong></td>	
	  <td class="bg4"><strong>答复状态</strong></td>
	  <td class="bg4"><strong>办理状态</strong></td>
	  <td class="bg4"><strong>审核状态</strong></td>
	  <td class="bg4"><strong>满意度</strong></td>	   
	  <td class="bg4"><strong>操   作</strong></td>
	</tr>
	<s:iterator value="flipPageInfo.data" status="data" id="d">
		<tr>
			<td><pro:optionValue optionName="proposal.proposalClassify" value="${flipPageInfo.data[data.index ][0].proposalClassify}" skipTop="true"/>${flipPageInfo.data[data.index ][0].proposalNo }号</td>
            <td>${util:chop(flipPageInfo.data[data.index ][1].userName,"10","...")}</td>	
			<td>${util:chop(flipPageInfo.data[data.index ][0].proposalBrief,"20","...")}</td>				
			<td><fmt:formatDate value="${flipPageInfo.data[data.index ][0].proposalSubmitDate}" pattern="yyyy-MM-dd"/></td>		    
			<td><pro:optionValue optionName="proposal.proposalUndertakeDeptSuggest" value="${flipPageInfo.data[data.index ][0].proposalUndertakeDeptSuggest }"/></td>	
			<td><pro:optionValue optionName="proposal.proposalDealStatus" value="${flipPageInfo.data[data.index ][0].proposalDealStatus }"/></td>
			<td>
				<c:if test="${flipPageInfo.data[data.index ][0].proposalStaffStatus == 1}">
				<font color="red">
				<pro:optionValue optionName="proposal.proposalStaffStatus" value="${flipPageInfo.data[data.index ][0].proposalStaffStatus }"/>
				</font>
				</c:if>
				<c:if test="${flipPageInfo.data[data.index ][0].proposalStaffStatus != 1}">
				<pro:optionValue optionName="proposal.proposalStaffStatus" value="${flipPageInfo.data[data.index ][0].proposalStaffStatus }"/>
				</c:if>
			<td>
				<c:if test="${flipPageInfo.data[data.index ][0].proposalSatisfy >= 4}">
				<font color="red">
				<pro:optionValue optionName="proposal.proposalSatisfy" value="${flipPageInfo.data[data.index ][0].proposalSatisfy }"  skipTop="true"/>
				</font>
				</c:if>
				<c:if test="${flipPageInfo.data[data.index ][0].proposalSatisfy < 4}">
				<pro:optionValue optionName="proposal.proposalSatisfy" value="${flipPageInfo.data[data.index ][0].proposalSatisfy }"  skipTop="true"/>
				</c:if>
			</td>
			<td>
				<c:if test="${role.roleId == ROLE_COMMITTEE}">
					<c:if test="${tianjieci.proposalSession == flipPageInfo.data[data.index ][0].proposalSession 
							&& tianjieci.proposalCount == flipPageInfo.data[data.index ][0].proposalCount}">
						<c:if test="${user.userId == flipPageInfo.data[data.index ][0].proposalUserIdFirst}">
							<a href="#" onclick="detailIt('${flipPageInfo.data[data.index ][0].proposalId }');">[查看]</a>
						</c:if>
						<c:if test="${user.userId != flipPageInfo.data[data.index ][0].proposalUserIdFirst}">
							<a href="#" style="color:gray;">[查看]</a>
						</c:if>
					</c:if>
					<c:if test="${tianjieci.proposalSession != flipPageInfo.data[data.index ][0].proposalSession 
							|| tianjieci.proposalCount != flipPageInfo.data[data.index ][0].proposalCount}">
						<a href="#" onclick="detailIt('${flipPageInfo.data[data.index ][0].proposalId }');">[查看]</a>
					</c:if>
				</c:if>
				<c:if test="${role.roleId != ROLE_COMMITTEE}">
					<a href="#" onclick="detailIt('${flipPageInfo.data[data.index ][0].proposalId }','${flipPageInfo.page }');">[查看]</a>
				</c:if>
				<c:if test="${role.roleId == ROLE_ADMIN}">
					<a href="#" onclick="modifyIt('${flipPageInfo.data[data.index ][0].proposalId }','${flipPageInfo.page }');">[修改]</a>
					<a href="#" onclick="deleteIt('${flipPageInfo.data[data.index ][0].proposalId }','${flipPageInfo.page }');">[删除]</a>
				</c:if>
				<c:if test="${role.roleId != ROLE_ADMIN}">
					<c:if test="${user.userId == flipPageInfo.data[data.index ][0].proposalUserIdFirst 
						&& flipPageInfo.data[data.index ][0].proposalStatus == PROPOSAL_NONE}">
						<a href="#" onclick="deleteIt('${flipPageInfo.data[data.index ][0].proposalId }','${flipPageInfo.page }');">[删除]</a>
					</c:if>
				</c:if>
			</td>
		</tr>
	</s:iterator>
</table> 

<form action="${ctx}/proposal/proposal!search.action" method="post" name="pageform">
	<div class="fy01" align="center">
		<jsp:include page="/WEB-INF/page/common/page.jsp" />
	</div>
	<input type="hidden" name="flipPageInfo.page" id="page" value="${flipPageInfo.page}" />
    <input type="hidden" name="startDate" value="<s:date name='startDate' format='yyyy-MM-dd' />"/>
	<input type="hidden" name="endDate" value="<s:date name='endDate' format='yyyy-MM-dd' />"/>
	<input type="hidden" name="s_proposalNo" value="${s_proposalNo }"/>
	<input type="hidden" name="s_proposalSession" value="${s_proposalSession }"/>
	<input type="hidden" name="s_proposalBrief" value="${s_proposalBrief }"/>
	<input type="hidden" name="s_proposalUserNameFirst" value="${s_proposalUserNameFirst }"/>
	<input type="hidden" name="s_jieBie" value="${s_jieBie }"/>
	<input type="hidden" name="s_workUnit" value="${s_workUnit }"/>
	<input type="hidden" name="s_proposalPrincipal" value="${s_proposalPrincipal }"/>	
	<input type="hidden" name="s_proposalAduitSuggestSelect" value="${s_proposalAduitSuggestSelect }"/>
	<input type="hidden" name="s_proposalRegisterTypeSelect" value="${s_proposalRegisterTypeSelect }"/>
	<input type="hidden" name="s_proposalClassify" value="${s_proposalClassify }"/>
	<input type="hidden" name="s_may" value="${s_may }"/>
	<input type="hidden" name="s_proposalMethod" value="${s_proposalMethod }"/>
	<input type="hidden" name="s_proposalSatisfy" value="${s_proposalSatisfy }"/>
	<input type="hidden" name="s_proposalSponsor" value="${s_proposalSponsor }"/>
	<input type="hidden" name="s_proposalNeeddo" value="${s_proposalNeeddo }"/>
	<input type="hidden" name="s_proposalSponsorId" value="${s_proposalSponsorId }"/>
	<input type="hidden" name="s_proposalNeeddoId" value="${s_proposalNeeddoId }"/>
	<input type="hidden" name="s_proposalDept" value="${s_proposalDept }"/>
	<input type="hidden" name="s_proposalDealStatus" value="${s_proposalDealStatus }"/>
	<input type="hidden" name="s_proposalStaffStatus" value="${s_proposalStaffStatus }"/>
	<input type="hidden" name="s_proposalUndertakeDeptSuggest" value="${s_proposalUndertakeDeptSuggest }"/>
	<input type="hidden" name="s_proposalTaketoDept" value="${s_proposalTaketoDept }"/>
	
</form>
<form action="${ctx}/proposal/proposal!modifyPre.action" method="post" name="modifyform">
	<input type="hidden" id="proposalId" name="proposal.proposalId" value="${proposal.proposalId }"/>
	<input type="hidden" name="flipPageInfo.page" id="page" value="${flipPageInfo.page}" />
    <input type="hidden" name="startDate" value="<s:date name='startDate' format='yyyy-MM-dd' />"/>
	<input type="hidden" name="endDate" value="<s:date name='endDate' format='yyyy-MM-dd' />"/>
	<input type="hidden" name="s_proposalNo" value="${s_proposalNo }"/>
	<input type="hidden" name="s_proposalSession" value="${s_proposalSession }"/>
	<input type="hidden" name="s_proposalBrief" value="${s_proposalBrief }"/>
	<input type="hidden" name="s_proposalUserNameFirst" value="${s_proposalUserNameFirst }"/>
	<input type="hidden" name="s_jieBie" value="${s_jieBie }"/>
	<input type="hidden" name="s_workUnit" value="${s_workUnit }"/>
	<input type="hidden" name="s_proposalPrincipal" value="${s_proposalPrincipal }"/>
	<input type="hidden" name="s_proposalAduitSuggestSelect" value="${s_proposalAduitSuggestSelect }"/>
	<input type="hidden" name="s_proposalRegisterTypeSelect" value="${s_proposalRegisterTypeSelect }"/>
	<input type="hidden" name="s_proposalClassify" value="${s_proposalClassify }"/>
	<input type="hidden" name="s_may" value="${s_may }"/>
	<input type="hidden" name="s_proposalMethod" value="${s_proposalMethod }"/>
	<input type="hidden" name="s_proposalSatisfy" value="${s_proposalSatisfy }"/>
	<input type="hidden" name="s_proposalSponsor" value="${s_proposalSponsor }"/>
	<input type="hidden" name="s_proposalNeeddo" value="${s_proposalNeeddo }"/>
	<input type="hidden" name="s_proposalDept" value="${s_proposalDept }"/>
	<input type="hidden" name="s_proposalDealStatus" value="${s_proposalDealStatus }"/>
	<input type="hidden" name="s_proposalStaffStatus" value="${s_proposalStaffStatus }"/>
	<input type="hidden" name="s_proposalUndertakeDeptSuggest" value="${s_proposalUndertakeDeptSuggest }"/>
	<input type="hidden" name="s_proposalTaketoDept" value="${s_proposalTaketoDept }"/>
</form>
</li>
		</ul>
	  </div>
	</div>
</div>
</body>
<!-- InstanceEnd --></html>
